# -*- coding: UTF-8 -*-
import mysql.connector
conn=mysql.connector.connect(user='root',password='password',database='test')
cursor=conn.cursor()
cursor.execute('drop table if exists class4')
cursor.execute('create table class4(id varchar(20) primary key,name varchar(20),classtime datetime)')
cursor.execute('insert into class4(id,name,classtime) values(%s,%s,%s)',['1','java','2017-1-6 18:02'])
cursor.execute('insert into class4(id,name,classtime) values(%s,%s,%s)',['2','C','2017-1-7 18:00'])
cursor.execute('select*from class4 where id in (1,2)')
values=cursor.fetchall()
values
print (values)